package net.j4love.spring.boot.config.yaml;

import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;

/**
 * @author He Peng
 * @create 2017-05-19 10:48
 * @update 2017-05-19 10:48
 * @see
 */
@Validated
@ConfigurationProperties("yamlConf")
public class YamlPropertyConfig {

    @NotEmpty
    @NotNull
    private String yaml;

    private List<String> servers = new ArrayList<String>();

    @Value("${val}")
    public String val;

    public String getYaml() {
        return yaml;
    }

    public void setYaml(String yaml) {
        this.yaml = yaml;
    }

    public List<String> getServers() {
        return servers;
    }

    public void setServers(List<String> servers) {
        this.servers = servers;
    }

    @Override
    public String toString() {
        return "YamlPropertyConfig{" +
                "yaml='" + yaml + '\'' +
                ", servers=" + servers +
                '}';
    }
}
